import 'package:flutter/cupertino.dart';
import 'package:url_launcher/url_launcher.dart';

class BtFilePreviewModel extends ChangeNotifier {
  String _name = '';

  String get name => _name;

  String _url = '';

  String get url => _url;

  BtFilePreviewModel(String name, String url) {
    _name = name;
    _url = url;
  }

  void openFile() async {
    var uri = Uri.parse(url);
    if (await canLaunchUrl(uri)) {
      launchUrl(uri, mode: LaunchMode.inAppWebView);
    }
  }
}
